package com.saer.client.dto;

import java.util.HashMap;

import com.google.gwt.user.client.rpc.IsSerializable;

public abstract class SearchDto implements IsSerializable {
	protected String transactionId = null;
	protected int requestType = 0;
	private HashMap<String, String> userAccesses = null;

	public void setUserAccesses(HashMap<String, String> userAccesses) {
		this.userAccesses = userAccesses;
	}

	public boolean isHasPathCostAccess() {
		return hasAccess("PATH_COST");
	}

	public boolean hasAccess(String access) {
		if (this.userAccesses != null) {
			return userAccesses.containsKey(access);
		}
		return false;
	}

	public int getRequestType() {
		return requestType;
	}

	public void setRequestType(int requestType) {
		this.requestType = requestType;
	}

	public String getTransactionId() {
		return transactionId;
	}

	public void setTransactionId(String transactionId) {
		this.transactionId = transactionId;
	}

}
